function vector_b = assemble_vector_b_1d(node, elem, function_f, dN, N_gauss_int1d)

vector_b = zeros(size(node,2), 1);

for n = 1:size(elem,1)
    E = node(elem(n,:));
    a = E(1);
    b = E(2);
    psi = function_transform_1d(-1, 1, dN, a, b);
    for beta = 1:size(elem,2)
        fpsi = @(xi) function_f(xi).*psi{beta}(xi);
        r = gauss_int1d(fpsi, a, b, N_gauss_int1d);
        i = elem(n,beta);
        vector_b(i,1) = vector_b(i,1) + r;
    end
end

end